import java.util.Stack;

public class Test {
    public static void main(String[] args) {
        MyStack myStack = new MyStack();
        myStack.push(1);
        myStack.push(2);
        System.out.println(myStack.peek());
        System.out.println("============");

        myStack.push(3);
        System.out.println(myStack.peek());
        System.out.println("============");

        myStack.pop();
        myStack.pop();
        System.out.println(myStack.peek());
        System.out.println("============");

        myStack.push(1);
        myStack.push(2);
        myStack.push(3);
        myStack.push(4);
        myStack.push(5);
        myStack.push(6);
        System.out.println(myStack.peek());
        System.out.println("============");

        myStack.display();


    }
    public static void main1(String[] args) {
        Stack<Integer> stack = new Stack();
        stack.push(3);
        stack.push(2);
        stack.push(1);
        System.out.println(stack.size());
        System.out.println(stack.peek());
        System.out.println("=====================");
        stack.pop();
        stack.pop();
        System.out.println(stack.peek());
        System.out.println("=====================");

        stack.pop();
        if(stack.empty()){
            System.out.println("栈为空");
        }else {
            System.out.println(stack.size());
        }
//        System.out.println(stack.peek());

    }
}
